#include "help_text.h"
#include "images_diffuse.h"
#include "tag.h"
#include "button.h"

#define GLFW_KEY_ENTER   257

declare_body(help_text, { })
declare_tick(help_text, {
	if(on_down(get_key(GLFW_KEY_ENTER))) return 1;
})
declare_draw(help_text, { })
declare_head(help_text)

entity *make_help_text(int frame) {
	entity *ent = ent_new();
	ent->tag = TAG_HELP_TEXT;
	
	sprite_renderer *sr = get_renderer(&sprite_help_text);
	sr->frame = frame;
	
	add_component(ent, sr);
	add_component(ent, c_new(help_text));
	
	return ent;
}

entity *make_continue() {
	entity *ent = ent_new();
	ent->tag = TAG_CONTINUE;
	
	sprite_renderer *sr = get_renderer(&sprite_success);
	
	add_component(ent, sr);
	add_component(ent, c_new(help_text));
	
	return ent;
}

entity *make_you_lost() {
	entity *ent = ent_new();
	ent->tag = TAG_YOU_LOST;
	
	sprite_renderer *sr = get_renderer(&sprite_failure);
	
	add_component(ent, sr);
	add_component(ent, c_new(help_text));
	
	return ent;
}

entity *make_title() {
	entity *ent = ent_new();
	ent->tag = TAG_TITLE;
	
	sprite_renderer *sr = get_renderer(&sprite_title);
	
	add_component(ent, sr);
	add_component(ent, c_new(help_text));
	
	return ent;
}

entity *make_you_win() {
	entity *ent = ent_new();
	ent->tag = TAG_TITLE;
	
	sprite_renderer *sr = get_renderer(&sprite_you_win);
	
	add_component(ent, sr);
	
	return ent;
}